<!DOCTYPE html>
<html>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title> New_Document </title>
		<meta name="Generator" content="EditPlus">
		<meta name="Author" content="">
		<meta name="Keywords" content="">
		<meta name="Description" content="">
		<link rel="stylesheet" href="css/swiper-3.4.1.min.css" />
		<script type="text/javascript" src="js/swiper-3.4.1.min.js">
		</script>
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="css/newmember.css" />

		<link rel="shortcut icon" href="img/favicon.ico" />
		<link rel="stylesheet" type="text/css" href="css/style.css" />
		<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
		<script type="text/javascript" src="js/luckDraw.js"></script>

		<script type="text/javascript" src="js/newmember.js">
		</script>
		<style type="text/css">
			.yLight{
				display: none;
			}
			.yL2{
				display: none;
			}
		</style>
	</head>

	<body>
		<div class="wrap">
			<div class="banner">
			</div>

			<div class="rolling">

				<div class="rule">
					<div class="ticketnum">
						我的船票号：<em> </em>
					</div>
					<div class="jifen">
						我的积分:<em> </em>分
						<span class="rulebutton" id="rulebutton">
								积分详情
							</span>
					</div>
					<div class="friendticket">
						输入好友登船票号得积分
						<input type="text" id="ticketNum" />
						<span class="rulebutton" id="ticketsure">
								确定
							</span>
					</div>
					<div class="ticketnum">
						联系ONE兔客服
						<span class="rulebutton" id="lianxikefu">
								联系客服
							</span>
					</div>
					<img src="img/tuoyuan.png" id="tuoyuan" />
				</div>
				<div class="bg">
					<img src="img/bg.png" alt="" />
				</div>
				<div class="rolltitle">
					<img src="img/rolltitle.png" />
				</div>
				<div class="kuang1">
					<div class="yLight" id="yLight">
						<img src="img/ylight.png" />
					</div>
					<div class="yLight" id="yLight2">
						<img src="img/ylight.png" />
					</div>
					<div class="yLight" id="yLight3">
						<img src="img/ylight.png" />
					</div>

					<!--积分-->
					<div class="jifen2">
						<span id="jifen2word">
								积分：<em></em>
							</span>
					</div>
					<div class="kuang2">

					</div>
					<div class="roll">
						<div class="myBox">
							<ul class="cj1">
								<li><img src="img/1.png" /></li>
							</ul>
						</div>
						<div class="neikuang">
							<div class="yL2" id="yL2">
								<img src="img/yl2.png" />
							</div>
						</div>
						<div class="centerTu">
						</div>
						<div class="myBox myBox2">
							<ul class="cj2">
								<li><img src="img/21.png" /></li>
							</ul>
						</div>
						<div class="buttonChou">
							<div id="button1"></div>
							<div id="button2"></div>
							<div id="button3"></div>
							<div id="button4"></div>
							<div class='text'>
								<div class="bt bt1"></div>
								<!--<div class='jg jg1'>中奖者为"<em></em>"号</div>-->
							</div>
							<div class='text'>
								<div class="bt bt2"></div>
								<!--<div class='jg jg2'>中奖者为"<em></em>"号</div>-->
							</div>
						</div>

					</div>

				</div>

			</div>
			<div class="paomadeng">
				<div class="activity" id="J_Activity">
					<div class="lingling">

					</div>
					<ul>

					</ul>
				</div>
			</div>
			<div class="downrule">
				<div class="downruleTitle">
					<img src="img/lujiangrule.png" />
				</div>
				<div class="downruleLb">

					<div class="swiper-pagination"></div>
					<div class="swiper-container">
						<div class="swiper-wrapper">
							<div class="swiper-slide"><img src="img/rule1.png" /></div>
							<div class="swiper-slide"><img src="img/rule2.png" /></div>
							<div class="swiper-slide"><img src="img/rule3.png" /></div>
						</div>
					</div>
				</div>
			</div>

		</div>
		<!--蒙版-->
		<div class="black" style="display: none;width: 100%;height: 100%;background: black;opacity: 0.6;position: fixed;top:0;z-index: 100000000000;">

		</div>
		<!--中奖弹框-->
		<div class="win">
			<div class="cannal">

			</div>
			<div class="winword">
				<div class="winwordTitle">
					恭喜你，撸到奖了！
				</div>
				<div class="winwordCon">
					撸中<span></span>
				</div>
			</div>
			<div class="address">

			</div>
		</div>
		<!--中现金-->
		<div class="win2">
			<div class="cannal">

			</div>
			<div class="winword2">
				<div class="winwordTitle2">
					恭喜你，撸到奖了！
				</div>
				<div class="winwordCon2">
					撸中<span></span>
				</div>
			</div>
			<div class="address2">

			</div>
		</div>
		<!--中积分-->
		<div class="win3">
			<div class="cannal">

			</div>
			<div class="winword3">
				<div class="winwordTitle3">
					恭喜你，撸到奖了！
				</div>
				<div class="winwordCon3">
					撸中<span></span>
				</div>
			</div>
			<div class="address3">

			</div>
		</div>
		<!--中流量-->
		<div class="win4">
			<div class="cannal">

			</div>
			<div class="winword4">
				<div class="winwordTitle4">
					恭喜你，撸到奖了！
				</div>
				<div class="winwordCon4">
					撸中<span></span>
				</div>
			</div>
			<div class="address4">

			</div>
		</div>
		<!--弹框-->
		<div class="lose">
			<div class="cannal">

			</div>
			<div class="winword">
				<div class="winwordTitle">
					哎呀，很遗憾！
				</div>
				<div class="winwordCon">
					换个姿势，再来一次
				</div>
			</div>
			<div class="sure">

			</div>
		</div>
		<!--积分不足-->
		<div class="nointegral">
			<div class="cannal">

			</div>
			<div class="sure">

			</div>
		</div>
		<div class="first">
			<div class="firstSure">

			</div>
		</div>
		<!--验证码错误-->
		<div class="nointegral2">
			<div class="cannal">

			</div>
			<div class="sure">

			</div>
		</div>


	</body>
	<script type="text/javascript">
		var userid = document.URL.split("?")[1].split("&")[0].split("=")[1];
			function openShare(msg) {
					if(msg==1){
					alert("测试中"+userid);
			    		$.ajax({
							url: 'http://test.onetuu.com/Activity/share', //跨域到http://www.wp.com，另，http://test.com也算跨域
							type: 'post', //jsonp 类型下只能使用GET,不能用POST,这里不写默认为GET
							dataType: 'json', //指定为jsonp类型
							data: { //数据参数
								"userid":userid,
								"suc":msg
							},
							success: function(data) {
								console.log(data);
								if(data.eligibility == 2){
									alert("系统错误");
								}
							}
						});
			    		
			       }
			}
		$(function() {
			var u = navigator.userAgent;
			var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
			var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
			
			
			
			var mySwiper = new Swiper('.swiper-container', {
				pagination: '.swiper-pagination',
				paginationClickable: true,
				effect: 'cube',
				cube: {
					slideShadows: true,
					shadow: false,
					shadowOffset: 100,
					shadowScale: 0.6
				}

			})

			var dataPrizeid = 0;
			//奖品id
			var prizeId = 0;
			//用户id
			var userId = 0;
			//内外环
			var cLass = 0;
			//点击抽奖
			
			
//			
			
			
			
			
			//进入页面接口(积分,船票号,余额)
			$.ajax({
				url: 'http://test.onetuu.com/Activity/turntable', //跨域到http://www.wp.com，另，http://test.com也算跨域
				type: 'post', //jsonp 类型下只能使用GET,不能用POST,这里不写默认为GET
				dataType: 'json', //指定为jsonp类型
				data: { //数据参数
					"userid":userid,
				},
				success: function(data) {
					console.log(data);
					if(data.eligibility==2){
						alert("系统错误！");
					}
					if(data.isfirst == 1) {
						//10积分+分享
						$(".black,.first").show();
						$(".firstSure").on("touchend", function() {
							$(".black,.first").hide();
						});
					}
					$("#jifen2word em,.jifen em").text(data.integral);
					$(".ticketnum em").text(data.ticket);
					var paoMa = "";
					if(data.turntable.length > 5) {
						up();
					}
					for(var i = 0; i < data.turntable.length; i++) {
						paoMa += ' <li>恭喜' + data.turntable[i].username + '获得了' + data.turntable[i].name + '</li>';
					}
					listPanel.append(paoMa);
					
					//联系客服
					$("#lianxikefu").on("touchend",function(){
						window.location.href = "customer.html?userid="+userid;
					});
					
				}
			});
			
			
			

			//外环抽奖
			$("#button1").on("touchend", function() {
			  if(confirm("确定花费50积分抽奖么？")){
			  	$(".yLight").show();
				time(140);
				$("#button4").show();
				$("#button3").show();
				$.ajax({
					url: 'http://test.onetuu.com/Activity/luckyDraw', //跨域到http://www.wp.com，另，http://test.com也算跨域
					type: 'post', //jsonp 类型下只能使用GET,不能用POST,这里不写默认为GET
					dataType: 'json', //指定为jsonp类型
					data: { //数据参数
						"userid": userid,
						"class": 1
					},
					success: function(data) {
						console.log(data);
						if(data.eligibility == 1) {
							dataPrizeid = data.prizeid;

							$('.cj1').myLuckDraw({
								row: 5, //行
								column: 5, //列
								spacing: 5, //空隙
								part: 1, //第一个圈
								click: '#button1', //点击触发
								time: 2, //匀速运动的时间
								end: function(e) {
									//								//抽奖执行完毕的回调函数,参数e为获奖编号
									//								//因为这里是指定的，所以e == 12
									//					$('.jg1 em').text(e-5);
									clearInterval(time1);
									time(140);
									setTimeout(function() {
										if(data.jpclass == 1) {
											$(".winwordCon span").text(data.name);
											$(".black,.win").show();
											$(".address").on("touchend", function() {
//												if(isiOS){
//														window.webkit.messageHandlers.openSecret.postTitle("添加地址");//ios显示头像信息
//												}else{
//														window.AndroidWebView.AndpostTitle("添加地址"); //发送
//												}
												$(".black,.win,#button4,#button3").hide();
												window.location.href = "address.html?recordid=" + data.recordid + "&class=" + data.jpclass+"&userid="+userid;
											});
										} else if(data.jpclass == 2) {
											$(".winwordCon2 span").text(data.name);
											$(".black,.win2").show();
											$(".address2").on("touchend", function() {
//												if(isiOS){
//													window.webkit.messageHandlers.openSecret.postTitle("添加联系方式");//ios显示头像信息
//													}else{
//													window.AndroidWebView.AndpostTitle("添加联系方式"); //发送
//												}	
												$(".black,.win2,#button4,#button3").hide();
												window.location.href = "address.html?recordid=" + data.recordid + "&class=" + data.jpclass+"&userid="+userid;
											});
										} else if(data.jpclass == 3) {
											$(".winwordCon3 span").text(data.name);
											$(".black,.win3").show();
											$(".address3").on("touchend", function() {
												$.ajax({
													url: 'http://test.onetuu.com/Activity/addIntegral', //跨域到http://www.wp.com，另，http://test.com也算跨域
													type: 'post', //jsonp 类型下只能使用GET,不能用POST,这里不写默认为GET
													dataType: 'json', //指定为jsonp类型
													data: { //数据参数
														"userid": userid,
														"integral": 30
													},
													success: function(data) {
														console.log(data);
														
														window.location.reload();
													}
												});
												$(".black,.win3,#button4,#button3").hide();
											});
										} else if(data.jpclass == 4) {
											$(".winwordCon4 span").text(data.name);
											$(".black,.win4").show();
											$(".address4").on("touchend", function() {
												$(".black,.win4").hide();
												$("#button4,#button3").hide();
												//流量领取地址
												window.location.href= data.llurl;
//												window.location.reload();
											});
										}

									}, 900);

								}
							}, dataPrizeid);
							$("#button1").click();
							$("#jifen2word em,.jifen em").text(data.integral);
						} else if(data.eligibility == 2) {
							//积分不足弹框
							$(".black,.nointegral").show();
						}
					}
				});
			  }

			})
			//内环抽奖
			$("#button2").on("touchend", function() {
			  if(confirm("确定花费10积分抽奖么？")){
			  	$(".yL2").show();
				Time(130);
				$("#button3").show();
				$("#button4").show();
				$.ajax({
					url: 'http://test.onetuu.com/Activity/luckyDraw', //跨域到http://www.wp.com，另，http://test.com也算跨域
					type: 'post', //jsonp 类型下只能使用GET,不能用POST,这里不写默认为GET
					dataType: 'json', //指定为jsonp类型
					data: { //数据参数
						"userid": userid,
						"class": 2
					},
					success: function(data) {
						console.log(data);
						if(data.eligibility == 1) {
							dataPrizeid = data.prizeid - 16;

							$('.cj2').myLuckDraw({
								row: 3, //行
								column: 3, //列
								spacing: 5, //空隙
								part: 2,
								click: '#button2', //点击触发
								time: 2, //匀速运动的时间
								end: function(e) {
									//抽奖执行完毕的回调函数,参数e为获奖编号
									//因为这里是指定的，所以e == 12
									//					$('.jg2 em').text(e);
									clearInterval(time11);
									Time(130);
									setTimeout(function() {
										if(data.jpclass == 1) {
											$(".winwordCon span").text(data.name);
											$(".black,.win").show();
											$(".address").on("touchend", function() {
												//if(isiOS){
												//		window.webkit.messageHandlers.openSecret.postTitle("添加地址");//ios显示头像信息
												//}else{
												//		window.AndroidWebView.AndpostTitle("添加地址"); //发送
												//}
												$(".black,.win,#button4,#button3").hide();
												window.location.href = "address.html?recordid=" + data.recordid + "&class=" + data.jpclass+"&userid="+userid;
											});
										} else if(data.jpclass == 2) {
											$(".winwordCon2 span").text(data.name);
											$(".black,.win2").show();
											$(".address2").on("touchend", function() {
//												if(isiOS){
//													 window.webkit.messageHandlers.openSecret.postTitle("添加联系方式");//ios显示头像信息
//												}else{
//													 window.AndroidWebView.AndpostTitle("添加联系方式"); //发送
//												}	
												$(".black,.win2,#button4,#button3").hide();
												window.location.href = "address.html?recordid=" + data.recordid + "&class=" + data.jpclass+"&userid="+userid;
										
											});
										} else if(data.jpclass == 3) {
											$(".winwordCon3 span").text(data.name);
											$(".black,.win3").show();
											$(".address3").on("touchend", function() {
												var jf =data.prizeid;
												var intJf ="";
												if(jf==18){
													intJf =50;
												}else if(jf==24){
													intJf =20;
												}
												$.ajax({
													url: 'http://test.onetuu.com/Activity/addIntegral', //跨域到http://www.wp.com，另，http://test.com也算跨域
													type: 'post', //jsonp 类型下只能使用GET,不能用POST,这里不写默认为GET
													dataType: 'json', //指定为jsonp类型
													data: { //数据参数
														"userid": userid,
														"integral": intJf
													},
													success: function(data) {
														console.log(data);
														window.location.reload();
													}
												});
												$(".black,.win3,#button4,#button3").hide();
												window.location.reload();
											});
										} else if(data.jpclass == 4) {
											$(".winwordCon4 span").text(data.name);
											$(".black,.win4").show();
											$(".address4").on("touchend", function() {
												$(".black,.win4").hide();
												$("#button4,#button3").hide();
											
												//流量领取地址
												window.location.href= data.llurl;
//												window.location.reload();
											});
										}else if(data.jpclass == 5) {
											$(".winwordCon4 span").text(data.name);
											$(".black,.lose").show();
											
										}

									}, 900);
								}
							}, dataPrizeid);
							$("#button2").click();
							$("#jifen2word em,.jifen em").text(data.integral);
						} else {
							$(".black,.nointegral").show();
						}
					}
				});
			 }
			})
			//验证船票号
			$("#ticketsure").on("touchend", function() {
				console.log($("#ticketNum").val());
				var Num = $("#ticketNum").val();
				if(Num == "") {
					alert("请输入好友船票号");
				} else {
					$.ajax({
						url: 'http://test.onetuu.com/Activity/userCode', //跨域到http://www.wp.com，另，http://test.com也算跨域
						type: 'post', //jsonp 类型下只能使用GET,不能用POST,这里不写默认为GET
						dataType: 'json', //指定为jsonp类型
						data: { //数据参数
							"userid": userid,
							"code": Num
						},
						success: function(data) {
							console.log(data);
							if(data.tip == 1) {
//								alert("您的操作有误");
								//							弹框输入有误
								$(".black,.nointegral2").show();
							} else if(data.tip == 0) {
								//add积分
								$("#jifen2word em,.jifen em").text(data.integral);
								alert('您的积分充值成功！');
							}
						}
					});
				}
				//			
			})
			//关闭弹框
			$(".sure").on("touchend", function() {
				$(".black,.lose,.win,.win1,.win2,.win3,.win4,.nointegral,.nointegral2").hide();
				setTimeout(function(){
					$("#button4,#button3").hide();
				},500);
				
				window.location.reload();
//				window.location.href = document.URL;
			});
			//积分详情
			$("#rulebutton").on("touchend", function() {

				window.location.href = "detail.html?userid="+userid;
			});
			//联系客服
			

			//外环初始化
			$('.cj1').myLuckDraw({
				row: 5, //行
				column: 5, //列
				spacing: 5, //空隙
				part: 1, //第一个圈
				click: '.bt1', //点击触发
				time: 1, //匀速运动的时间
				end: function(e) {
					//	//抽奖执行完毕的回调函数,参数e为获奖编号
					//	//因为这里是指定的，所以e == 12
					//	$('.jg1 em').text(e-5);
					clearInterval(time1);
					time(140);
					//								$(".black").show();

				}
			}, dataPrizeid); //这里tar是确定想要抽奖的目标是几号
			//内环初始化
			$('.cj2').myLuckDraw({
				row: 3, //行
				column: 3, //列
				spacing: 5, //空隙
				part: 2,
				click: '.bt2', //点击触发
				time: 2, //匀速运动的时间
				end: function(e) {
					//抽奖执行完毕的回调函数,参数e为获奖编号
					//因为这里是指定的，所以e == 12
					//					$('.jg2 em').text(e);
					clearInterval(time11);
					Time(130);
				}
			}, 3);

		});

		//跑马灯
		var listPanel = $('#J_Activity ul');
		var z = 0;
		up();

		function up() { //向上滚动

			listPanel.animate({ //向上滚动距离
				'top': (z - 25) + 'px'
			}, 1500, 'linear', function() {
				listPanel.css({
						'top': '0px'
					})
					.find("li:first").appendTo(listPanel); //循环，把第一个压到列表最后一个
				up();
			});
		}

		//灯	
		//外环
		var arr = [{ l: .11, t: -.09 }, { l: .49, t: -.09 }, { l: .87, t: -.09 }, { l: 1.2, t: -.09 }, { l: 1.6, t: -.09 }, { l: 1.98, t: -.09 }, { l: 2.35, t: -.09 }, { l: 2.7, t: -.09 }, { l: 3.08, t: -.09 },
			{ l: 3.3, t: .16 }, { l: 3.3, t: .55 }, { l: 3.3, t: .95 }, { l: 3.3, t: 1.35 }, { l: 3.3, t: 1.75 }, { l: 3.3, t: 2.15 }, { l: 3.3, t: 2.55 }, { l: 3.3, t: 2.95 }, { l: 3.3, t: 3.35 }, { l: 3.3, t: 3.73 }, { l: 3.3, t: 4.1 },
			{ l: 3.05, t: 4.35 }, { l: 2.7, t: 4.35 }, { l: 2.34, t: 4.35 }, { l: 1.95, t: 4.35 }, { l: 1.59, t: 4.35 }, { l: 1.2, t: 4.35 }, { l: .85, t: 4.35 }, { l: .48, t: 4.35 }, { l: .09, t: 4.35 },
			{ l: -.09, t: 4.1 }, { l: -.09, t: 3.73 }, { l: -.09, t: 3.36 }, { l: -.09, t: 2.95 }, { l: -.09, t: 2.55 }, { l: -.09, t: 2.16 }, { l: -.09, t: 1.75 }, { l: -.09, t: 1.35 }, { l: -.09, t: .95 }, { l: -.09, t: .55 }, { l: -.09, t: .15 }
		];
		//内环
		var arr2 = [{ l: 0.03, t: 0 }, { l: .34, t: 0 }, { l: .66, t: 0 }, { l: .98, t: 0 }, { l: 1.31, t: 0 }, { l: 1.62, t: 0 },
			{ l: 1.67, t: .145 }, { l: 1.67, t: .475 }, { l: 1.67, t: .8 }, { l: 1.67, t: 1.16 }, { l: 1.67, t: 1.48 },
			{ l: 1.62, t: 1.64 }, { l: 1.3, t: 1.64 }, { l: .98, t: 1.64 }, { l: .67, t: 1.64 }, { l: .35, t: 1.64 }, { l: .03, t: 1.64 },
			{ l: -.01, t: 1.48 }, { l: -.01, t: 1.13 }, { l: -.01, t: .8 }, { l: -.01, t: .46 }, { l: -.01, t: .14 }
		];
		var count = 0;
		var cou2 = 0;
		var cou3 = 0;
		var count2 = 0;
		var img = document.getElementById("yLight");
		var img2 = document.getElementById("yLight2");
		var img3 = document.getElementById("yLight3");
		var imgIn = document.getElementById("yL2");
		var time1 = "";
		var time2 = "";

		function time(x) {
			time1 = setInterval(function() {
				img.style.left = arr[count].l + "rem";
				img.style.top = arr[count].t + "rem";
				img2.style.left = arr[cou2 + 1].l + "rem";
				img2.style.top = arr[cou2 + 1].t + "rem";
				img3.style.left = arr[cou3 + 2].l + "rem";
				img3.style.top = arr[cou3 + 2].t + "rem";
				if(cou3 == 37) {
					count++;
					cou2++;
					cou3 = -2;
				} else {
					if(cou2 == 38) {
						cou2 = -1;
						count++;
					} else {
						if(count == 39) {
							count = 0;
						} else {
							count++;
						}
						cou2++;
					}
					cou3++;
				}
				//				
				//				
			}, x);
		}
//		time(140);
		//内环计时器
		function Time(m) {
			time11 = setInterval(function() {
				imgIn.style.left = arr2[count2].l + "rem";
				imgIn.style.top = arr2[count2].t + "rem";

				if(count2 == 21) {
					count2 = 0;
				} else {
					count2++;
				}
			}, m);
		}
//		Time(130);

	</script>

</html>